#pragma once

__gc class AnimObject : public Object
{
private:
	TGNAni *ani;

public:

	ArrayList *frames;

	AnimObject()
	{
		ani = NULL;
		frames = new ArrayList;
	}

	void SetAni(TGNAni *newAni)
	{
		ani = newAni;
	}

	TGNAni *GetAni()
	{
		return ani;
	}

	int GetNumFrames()
	{
		if(ani)
			return ani->numFrames;

		return 0;
	}

	int AddFrame(FrameObject *newFrame)
	{
		return frames->Add(newFrame);
	}

	void DeleteFrame(int index)
	{
		if(index >= frames->Count || index < 0)
			return;

		frames->Remove(frames->Item[index]);
	}

	void UpdateFrame(int index, FrameObject *newFrame)
	{
		if(frames->Item[index])
			frames->Item[index] = newFrame;
	}

	FrameObject *GetFrame(int index)
	{
		if(index >= frames->Count || index < 0)
			return NULL;

		return (FrameObject*)frames->Item[index];
	}

	String *ToString()
	{
		return System::Runtime::InteropServices::Marshal::PtrToStringAnsi(ani->name);
	}
};